[Discounts] Described Discounts API#2783
Conversation
Preview of modified filesPreview of modified Markdown: |
| new IsInRegions(['germany', 'france']), | ||
| new IsProductInArray(['product-1', 'product-2']), | ||
| new IsInCurrency('EUR'), | ||
| new IsValidDiscountCode($discountCode->getCode(), $discountCode->getUsedLimit()), |
There was a problem hiding this comment.
There was a problem hiding this comment.
Maybe @Steveb-p can clarify, but to me it's the max usage.
| $discountCode = $this->discountCodeService->createDiscountCode($discountCodeCreateStruct); | ||
|
|
||
| $discountCreateStruct = new DiscountCreateStruct(); | ||
| $discountCreateStruct->setIdentifier('discount_identifier') |
There was a problem hiding this comment.
I've chosen the fluent API usage over the constructor, as this is self-documenting for the code sample - I'd just use the constructor in "standard" code.
I hope it will be clear for the readers that they can just use the constructor.
| ## Search | ||
|
|
||
| You can search for Discounts using the [`DiscountServiceInterface::findDiscounts()](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html#method_findDiscounts) method. | ||
| To learn more about the available search options, see Discounts' Search Criteria and Sort Clauses. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
konradoboza
left a comment
There was a problem hiding this comment.
Very solid overall 💪 A few remarks from my end:
| new IsInRegions(['germany', 'france']), | ||
| new IsProductInArray(['product-1', 'product-2']), | ||
| new IsInCurrency('EUR'), | ||
| new IsValidDiscountCode($discountCode->getCode(), $discountCode->getUsedLimit()), |
There was a problem hiding this comment.
Maybe @Steveb-p can clarify, but to me it's the max usage.
|
@konradoboza thank you for your suggestions, I've applied them in e141ad2 Please note that I've added a small note on Discount Statuses. |
adriendupuis
left a comment
There was a problem hiding this comment.
I'm lost with expression values and condition Identifiers in REST. Maybe it's only for migration, not REST?
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
code_samples/ change report
|
This PR describes how you can use the Discounts PHP API and the core concepts needed to work with it.
Previews: